<%--
  Created by IntelliJ IDEA.
  User: cjegzfz
  Date: 2020/9/3
  Time: 7:57
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page trimDirectiveWhitespaces="true"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://" + request.getServerName()
          + ":" + request.getServerPort() + path + "/";
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title></title>
  <link href="<%=basePath%>Css/Content.css" rel="stylesheet" type="text/css" />
  <!-- Bootstrap Core CSS -->
  <link href="<%=basePath%>Css/bootstrap.min.css" rel="stylesheet" />
  <link href="<%=basePath%>Css/button.css" rel="stylesheet" type="text/css" />
  <link href="<%=basePath%>Css/dataTables.bootstrap.css" rel="stylesheet" />
  <link href="<%=basePath%>Css/metisMenu.min.css" rel="stylesheet" />
  <!-- 引入js文件 -->
  <!-- jQuery -->
  <script src="<%=basePath%>js/jquery-1.11.3.min.js"></script>
  <!-- Bootstrap Core JavaScript -->
  <script src="<%=basePath%>js/bootstrap.min.js"></script>
  <!-- Metis Menu Plugin JavaScript -->
  <script src="<%=basePath%>js/metisMenu.min.js"></script>
  <!-- DataTables JavaScript -->
  <script src="<%=basePath%>js/jquery.dataTables.min.js"></script>
  <script src="<%=basePath%>js/dataTables.bootstrap.min.js"></script>

  <!-- Custom Theme JavaScript -->
  <script src="<%=basePath%>js/sb-admin-2.js"></script>
  <script type="text/JavaScript">



    function addGrade(){
      var form = document.forms[0];
      form.action = "<%=basePath%>/addGrade.action";
      form.method="post";
      form.submit();
    }
    var $ = function (id) {
      return document.getElementById(id);
    }

    function show_menu(num) {
      for (j = 0; j < 100; j++) {
        if (j != num) {
          if ($('Oli' + j)) {
            $('Oli' + j).style.display = 'none';
            $('O' + j).style.background = 'url(images/01.gif)';
          }
        }
      }
      if ($('Oli' + num)) {
        if ($('Oli' + num).style.display == 'block') {
          $('Oli' + num).style.display = 'none';
          $('O' + num).style.background = 'url(images/01.gif)';
        } else {
          $('Oli' + num).style.display = 'block';
          $('O' + num).style.background = 'url(images/02.gif)';
        }
      }
    }

    var temp = 0;

    function menu_hide_show() {
      if (temp == 0) {
        document.getElementById('LeftBox').style.display = 'none';
        document.getElementById('RightBox').style.marginLeft = '0';
        document.getElementById('Mobile').style.background = 'url(images/menu_show.gif)';
        temp = 1;
      }
      else {
        document.getElementById('RightBox').style.marginLeft = '222px';
        document.getElementById('LeftBox').style.display = 'block';
        document.getElementById('Mobile').style.background = 'url(images/menu_hide.gif)';
        temp = 0;
      }
    }




  </script>
</head>

<body onload="show_menu(1);">

<div class="div_top" >成绩信息添加</div>
<div class="row">
  <div class="col-sm-3"></div>
  <div class="col-sm-6">
    <form  class="form-horizontal" style="margin-top: 30px" name="CustomerForm">
      <div class="form-group">
        <label for="username" class="col-sm-3 control-label">
          学生
        </label>
        <div class="col-sm-9">
          <select class="form-control" id="username" name="username">
            <c:forEach items="${Users}" var="user">
              <option value="${user.username}"  >${user.username}</option>
            </c:forEach>
          </select>

        </div>
      </div>
      <div class="form-group">
        <label for="studentClass" class="col-sm-3 control-label">
          班级
        </label>
        <div class="col-sm-9">
          <select class="form-control" id="studentClass" name="studentClass">
            <c:forEach items="${cClasses}" var="cClass" >
              <option value="${cClass.studentClass}" >${cClass.studentClass}</option>
            </c:forEach>

          </select>

        </div>
      </div>
      <div class="form-group">
        <label for="math_grades"  class="col-sm-3 control-label">
          数学成绩
        </label>
        <div class="col-sm-9"><input class="form-control" type="text" id="math_grades" name="math_grades">
        </div>
      </div>
      <div class="form-group">
        <label for="english_grades" class="col-sm-3 control-label">
          英语成绩
        </label>
        <div class="col-sm-9">
          <input type="text" class="form-control" id="english_grades" name="english_grades">
        </div>
      </div>

      <div class="form-group">
        <label for="chinese_grades" class="col-sm-3 control-label">
          语文成绩
        </label>
        <div class="col-sm-9">
          <input type="text" class="form-control" id="chinese_grades" name="chinese_grades">
        </div>
      </div>

      <div class="form-group">
        <div class="col-sm-5"></div>
        <div class="col-sm-2">
          <input type="button" class="button button-primary button-3d button-small" value="成绩添加" onclick="addGrade()">
        </div>
        <div class="col-sm-5"></div>
      </div>
    </form>
  </div>
  <div class="col-sm-3"></div>
</div>




<%--<h1>添加订单</h1>--%>
<%--<form action="" name="CustomerForm">--%>

<%--  <p>--%>
<%--  成绩编号：<input type="text" name="gradesId">--%>
<%--  </p>--%>
<%--  <p>--%>
<%--  学号：<input type="text" name="id">--%>
<%--</p>--%>
<%--  <p>--%>

<%--  学生名：<input type="text" name="username">--%>
<%--</p>--%>
<%--  <p>--%>
<%--  数学成绩：<input type="text" name="math_grades">--%>
<%--</p>--%>
<%--  <p>--%>
<%--  英语成绩：<input type="text" name="english_grades">--%>
<%--</p>--%>
<%--  <p>--%>
<%--    语文成绩：<input type="text" name="chinese_grades">--%>
<%--  </p>--%>
<%--  <p>--%>
<%--  <input type="button" value="添加" onclick="addGrade()">--%>
<%--  </p>--%>
<%--</form>--%>


</body>
<script>var flag=${message}
  if(flag==1){
    alert('录入失败，请勿重复录入和检查班级是否正确。');
  }
</script>
</html>
